//
//  Scene_Setting.h
//  StarBugs
//
//  Created by ?? ? on 6/25/12.
//  Copyright 2012 antisword@playorca.com. All rights reserved.
//

#ifndef __Scene_Setting_h__
#define __Scene_Setting_h__

#include "cocos2d.h"

enum{
    settingState_init,
    settingState_normal,
    settingState_gotoAbout,
    settingState_about,
    settingState_gotoInfo,
    settingState_info,
    settingState_gotoMainmenu,
    settingState_gotoSetting,
};

class Scene_Setting: public cocos2d::CCLayer
{
private:
    cocos2d::CCSize winSize;
//    cocos2d::CCLayerColor *mainLayer;
//    cocos2d::CCLayer *mainLayer;
    cocos2d::CCLayer *settingLayer;
    cocos2d::CCLayer *creditsLayer;
    cocos2d::CCLayer *creditMoveLayer;
    cocos2d::CCLayer *infoLayer;
    
    cocos2d::CCSprite *button_bg;
    cocos2d::CCSprite *button_effect;
    cocos2d::CCSprite *button_about;
    cocos2d::CCSprite *button_info;
    cocos2d::CCSprite *button_restore;
    cocos2d::CCSprite *button_back;
    
    cocos2d::CCSprite *button_eula;
    cocos2d::CCSprite *button_privacy;
    cocos2d::CCSprite *button_terms;
    
    cocos2d::CCArray *aboutArray;
    
    int settingState;
    bool isBgPlay;
    bool isEffPlay;
    int creditCnt;
    
    virtual void ccTouchesBegan(cocos2d::CCSet* touches, cocos2d::CCEvent* event);
    virtual void ccTouchesMoved(cocos2d::CCSet* touches, cocos2d::CCEvent* event);
    virtual void ccTouchesEnded(cocos2d::CCSet* touches, cocos2d::CCEvent* event);
    
    void addSettingLayer();
    void addCreditsLayer();
    void addInfoLayer();
    void changeSettingState(int state);
    
    void setBgSound();
    void setEffectSound();
    void tick(float dt);
public:
    Scene_Setting();
    ~Scene_Setting();
    static cocos2d::CCScene* scene();
    static void callback_restore();
};

#endif//__Scene_Setting_h__
